<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>第二次</title> 
</head>
<body>
    <script>
var n=prompt("几行")
for (var i = 1; i <= n; i++) {
          for (var k = i; k <= n; k++) {
            document.write("&nbsp;");
          }
          for (var j = 1; j <= i; j++) {
            document.write("* ");
          }
          document.write("<br>");
        }
		

</script>

<script>
  var n=prompt("几行");
    for (a=0;a<n;a++) {
        for (c=a; c <=n; c++) {
            document.write("&emsp;");
        }
            for (b = 1; b<=5; b++) {
                document.write("&emsp;" + "*")
            }
        document.write("<br>");
    }
    
</script>
<script>
    var n=prompt("几行");
     for (var i = 1; i <= n; i++) {
         
          for (var k = 1; k <= n - i; k++) {
            document.write("&ensp;&ensp;");
          }
          
          for (var j = 1; j <= i * 2 - 1; j++) {
            document.write("*" + "&ensp;");
          }
          document.write("<br>");
        }
        for (var i =n - 1; i >= 1; i--) {
          for (var k = 1; k <= n - i; k++) {
            document.write("&ensp;&ensp;");
          }
          for (var j = 1; j <= 2 * i - 1; j++) {
            document.write("*" + "&ensp;");
          }
          document.write("<br>");
        }
      
</script>
</body>
</html>